package com.atguigu.标准代码;

import java.io.*;

public class 高效字符流一次一个字符数组复制字符文件 {
    public static void main(String[] args) throws IOException {
        //创建流
        BufferedReader br = new BufferedReader(new FileReader("源文件地址"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("目标文件地址"));
        //循环读写
        char[] chs = new char[1024];

        int len;

        while((len = br.read(chs)) != -1){
            //读多少写多少
            bw.write(chs,0,len);
            //不需要刷新
        }
        //关流
        br.close();
        bw.close();
    }
}
